	<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>{$pagetext['0']} - Ace Admin</title>

		<meta name="description" content="overview &amp; stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

		<!-- bootstrap & fontawesome -->
		<link rel="stylesheet" href="{__PUBLIC__}assets/css/bootstrap.min.css" />
		<link rel="stylesheet" href="{__PUBLIC__}assets/font-awesome/4.5.0/css/font-awesome.min.css" />

		<!-- page specific plugin styles -->

		<!-- text fonts -->
		<link rel="stylesheet" href="{__PUBLIC__}assets/css/fonts.googleapis.com.css" />

		<!-- ace styles -->
		<link rel="stylesheet" href="{__PUBLIC__}assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />

		<!--[if lte IE 9]>
			<link rel="stylesheet" href="assets/css/ace-part2.min.css" class="ace-main-stylesheet" />
		<![endif]-->
		<link rel="stylesheet" href="{__PUBLIC__}assets/css/ace-skins.min.css" />
		<link rel="stylesheet" href="{__PUBLIC__}assets/css/ace-rtl.min.css" />

		<!--[if lte IE 9]>
		  <link rel="stylesheet" href="assets/css/ace-ie.min.css" />
		<![endif]-->

		<!-- inline styles related to this page -->

		<!-- ace settings handler -->
		<script src="{__PUBLIC__}assets/js/ace-extra.min.js"></script>

		<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

		<!--[if lte IE 8]>
		<script src="{__PUBLIC__}assets/js/html5shiv.min.js"></script>
		<script src="{__PUBLIC__}assets/js/respond.min.js"></script>
		<![endif]-->
         <link rel="stylesheet" href="{__PUBLIC__}assets/style.css" />
	</head>


				
<link rel="stylesheet" href="{__PUBLIC__}assets/css/chosen.min.css" />

					
                  <form class="form-horizontal"  id="form" action="" method="post">
									<div class="widget-body">
                                   
													<div class="widget-main">
														<div>
															<label  class="formtitle" for="form-field-8">商品网址</label>

														<input type="text" name="url" id="url" value="{$ret['url']}" placeholder="输入商品链接(有优惠券请输入优惠券地址)" class="form-control" style="width:365px; ">
														</div>
 	
                                                        	<div>
															<label  class="formtitle" for="form-field-8">商品名称</label>

														<input type="text" name="productName" id="productName" value="{$ret['productName']}" placeholder="商品标题" class="form-control">
														</div>
                                                        
                                                        <div>
															<label  class="formtitle" for="form-field-8">平台</label>

														<input type="text" name="mallName" id="mallName" value="{$ret['mallName']}" placeholder="商城平台的名字" class="form-control">
														</div>
														<div>
															<label  class="formtitle" for="form-field-8">分类</label>

														<input type="text" name="1stCategoryName" id="1stCategoryName" value="{$ret['1stCategoryName']}" placeholder="可自写分类" class="form-control">
														</div>
														<div>
															<label  class="formtitle" for="form-field-8">原价</label>

														<input type="text" name="pcPrice" id="pcPrice" value="{$ret['pcPrice']}" placeholder="输入产品原来的价钱" class="form-control">
														</div>
														<div>
															<label  class="formtitle" for="form-field-8">现价</label>

														<input type="text" name="pcPriceOri" id="pcPriceOri" value="{$ret['pcPriceOri']}" placeholder="输入产品现在的销售价" class="form-control">
														</div>
														<div>
															<label  class="formtitle" for="form-field-8">优惠券</label>

														<select name="isCoupon" class="form-control" style="height:34px;">
                                            <option value="0" {if $ret['isCoupon']=='0'}selected="selected"{/if}>没券</option>
                                            <option value="1" {if $ret['isCoupon']=='1'}selected="selected"{/if}>有券</option>
                                            </select>
														</div>
														<div>
															<label  class="formtitle" for="form-field-8">佣金</label>

														<input type="text" name="pcComissionRate" id="pcComissionRate" value="{$ret['pcComissionRate']}" placeholder="佣金比例，请输入数字即可" class="form-control">
														</div>
														<div>
															<label  class="formtitle" for="form-field-8">类型</label>
                                            <select name="mallType" class="form-control" style="height:34px;">
                                            <option value="0" {if $ret['mallType']=='0'}selected="selected"{/if}>国内</option>
                                            <option value="1" {if $ret['mallType']=='1'}selected="selected"{/if}>国际</option>
                                            </select>
														</div>

                                                    <hr>
                                                        <div>
															<label  class="formtitle" for="form-field-8">推广文案</label>

														<textarea class="form-control" style="height:160px"  name="content" id="form-field-8" placeholder="推广文案">{$ret['content']}</textarea>
														</div>

														<hr>
											
													
                                                        	<div>
															<label  class="formtitle"  for="form-field-11">图片</label>


											<div class="uploadimg tupian" onClick="upthis()">
                                              {if !$ret['imgUrl']}
                                              <i class="ace-icon fa fa-cloud-upload"></i>
                                              <dt>600*330</dt>
                                              {else}
                                              <img src="{$ret['imgUrl']}" />
                                              {/if}
                                              
                                            </div>
										</div>
                                        <input type="text" class="form-control" name="imgUrl" id="tupian"   value="{$ret['imgUrl']}" style="display:none" >
                                                 <input type="file"  name="file"  id="up_tupian"  onChange="Uploadthis('tupian','up_tupian')" style="display:none"  >
                                        	<hr>

													
							
                          
                                                
										</div>
                                        <div style="width:100%; height:85px"></div>
								
                                
                                <div class="clearfix form-actions"  style=" bottom:-20px; width:100%; position:fixed" >
										<div class="col-md-offset-1 col-md-9">
											<input type="submit"  class="btn btn-info " id="save"  value="保存" style=" margin:0 auto" />

											
											
										</div>
									</div>
                                    
                                                   </div>
								
                                </form>     

			

			<!-- basic scripts -->

		<!--[if !IE]> -->
		<script src="{__PUBLIC__}assets/js/jquery-2.1.4.min.js"></script>

		<!-- <![endif]-->

		<!--[if IE]>
<script src="{__PUBLIC__}assets/js/jquery-1.11.3.min.js"></script>
<![endif]-->
		<script type="text/javascript">
			if('ontouchstart' in document.documentElement) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
        <script src="{__PUBLIC__}assets/js/ace-extra.min.js"></script>
	<!-- ace scripts -->
	<!--[if !IE]> -->
		<script src="assets/js/jquery-2.1.4.min.js"></script>

		<!-- <![endif]-->

		<!--[if IE]>
<script src="assets/js/jquery-1.11.3.min.js"></script>
<![endif]-->
		<script type="text/javascript">
			if('ontouchstart' in document.documentElement) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
		<script src="{__PUBLIC__}assets/js/bootstrap.min.js"></script>

		<!-- page specific plugin scripts -->

		<!--[if lte IE 8]>
		  <script src="{__PUBLIC__}assets/js/excanvas.min.js"></script>
		<![endif]-->
		<script src="{__PUBLIC__}assets/js/jquery-ui.custom.min.js"></script>
		<script src="{__PUBLIC__}assets/js/jquery.ui.touch-punch.min.js"></script>
		<script src="{__PUBLIC__}assets/js/bootbox.js"></script>
		<script src="{__PUBLIC__}assets/js/jquery.easypiechart.min.js"></script>
		<script src="{__PUBLIC__}assets/js/jquery.gritter.min.js"></script>
		<script src="{__PUBLIC__}assets/js/spin.js"></script>

		<!-- ace scripts -->
		<script src="{__PUBLIC__}assets/js/ace-elements.min.js"></script>
		<script src="{__PUBLIC__}assets/js/ace.min.js"></script>




		<!-- inline scripts related to this page -->
        <link rel="stylesheet" href="{__PUBLIC__}global/message/css/jquery.my-message.1.1.css" />
		<script type="text/javascript" src="{__PUBLIC__}global/message/js/jquery.my-message.1.1.js"></script>
        <script src="{__PUBLIC__}global/layer/layer.js"></script>
        <script src="{__PUBLIC__}assets/js/chosen.jquery.min.js"></script>
        <script src="{__PUBLIC__}global/js/Validform_v5.3.2_min.js"></script>
        <script src="{__PUBLIC__}global/js/ajaxfileupload.js"></script>
        <script src="{__PUBLIC__}global/js/index.js"></script>
		<script>
		//$('.chosen-select').chosen({allow_single_deselect:true}); 

		ZhiForm("#form","index.php?r=manage/caiji/addunion","保存中","保存","null");
		//ajax上传
	Uploadthis=function(obj,thisid){
	  layer.load(2);
		$.ajaxFileUpload({  
				url:'index.php?r=manage/File/items',  
				secureuri:false,  
				fileElementId:thisid,//file标签的id  
				dataType: 'json',//返回数据的类型    
				success: function (data, status) {  
				   $("#"+obj).val(data.url);
				   $('.'+obj).html('<img src="'+data.url+'">');
				   layer.closeAll('loading');
				}
			});  	
		
		}
	function upthis(){
	document.getElementById("up_tupian").click(); 	
     }
	 
	 $("#clickthis").click(function(){
		var loading= layer.msg('正在执行您的请求', {icon: 16});
		 var url=$("#url").val();
		 $.ajax({
		 url:'index.php?r=manage/items/ItemsGetInfo',
         type: 'post',
		 data:{url:url},  
         dataType: 'json',
         success: function(data){
			
			if(!data.title){
			//layer.msg('', function(){});
			layer.close(loading);
			error('无法获取数据');
			return false;
			}
			
			var items=eval(data);
			
			$("#title").val(data.title);
			$("#itemsurl").val(data.itemsurl);
			$("#taoToken").val(data.taoToken);
			$("#couponLinkTaoToken").val(data.couponLinkTaoToken);
			$("#couponShortLinkUrl").val(data.couponShortLinkUrl);
			$("#zkPrice").val(data.zkPrice);
			$("#couponInfo").val(data.couponInfo);
			$("#couponAmount").val(data.couponAmount);
			$("#yongjing").val(data.tkCommFee);
			$(".tupian").html('<img src='+data.pic +'>');
			$("#tupian").val(data.pic);
			
			if(data.model=='0'){
				message.add("当前是通用佣金模式", "success");
				layer.close(loading);
			}else if(data.model=='1'){
				$("#quanhou").val(parseFloat(data.zkPrice)-parseFloat(data.couponAmount))
				message.add("当前是高佣模式", "success");
				layer.close(loading);
			}
			 console.log(data);
			 
		 }
   });	

	 });

		</script>
		
	</body>
</html>
